bcr: Remove empty routes after read.
authoroliskoli <oliskoli>
Mon, 20 Aug 2007 22:24:19 +0000 (22:24 +0000)
committeroliskoli <oliskoli>
Mon, 20 Aug 2007 22:24:19 +0000 (22:24 +0000)
bcr.c

diff --git a/bcr.c b/bcr.c
index c9eaf340eab737ea7f1b19017372cd4ffa098b63..0be68f4f82d1ce68e43dbacd4a9bac778869237f 100644 (file)
--- a/bcr.c
+++ b/bcr.c
@@ -298,7 +298,12 @@ bcr_data_read(void)
                
                route_add_wpt(route, wpt);
        }
-       bcr_create_waypts_from_route(route);
+       
+       /* remove empty route */
+       if (route->rte_waypt_ct == 0)
+               route_del_head(route);
+       else
+               bcr_create_waypts_from_route(route);
 }
 
 /* %%% bcr write support %%% ----------------------------------- */